const Koa = require('koa')
const cors = require('@koa/cors')
const bodyParser = require('koa-bodyparser')
const userRouter = require('./router/user.js')

const app = new Koa()

app.use(cors())
app.use(bodyParser())
app.use(userRouter.routes(), userRouter.allowedMethods())
    
app.listen(3000, () => {
    console.log('Server running at http://localhost:3000')
})
